Open/Closed Principle
The Open/Closed Principle says software entities should be open for extension but closed for modification. In practice, I achieve this by identifying stable abstractions and introducing polymorphism, strategies, factories, plugins or configuration-driven behavior. The goal is not literally to never modify existing code; rather, frequently changing requirements should ideally be accommodated through new implementations instead of repeatedly editing stable, tested logic.
Use abstractions at points where behavior is expected to vary.
Use polymorphism instead of large conditional chains.
Strategy and Factory patterns commonly support OCP.
Avoid blindly creating abstractions for behavior that is unlikely to change.
OCP reduces regression risk when adding new variants.